import java.io.*;
import java.util.*;

public class PlayWithProps
{
	public static void main(String[] args) throws IOException
	{
		Properties props = new Properties( );
		props.setProperty("myApp.xsize", "52");
		props.setProperty("myApp.ysize", "79");
		// Add some more properties
		props.put("Height", "200");
		props.put("Width", "15");

		// Save to xml
		FileOutputStream fos = new FileOutputStream("properties.xml");
		props.storeToXML(fos, "Application Parameters" );
		fos.close();

		// Print the xml to the console
		FileInputStream fis = new FileInputStream("properties.xml");
		while (fis.available() > 0) {
			System.out.print("" + (char) fis.read());
		}
	}
}
